<template>
  <el-col class="info-wrapper" :span="23">
    <el-form
      ref="form"
      :model="searchParams"
      class="search-from main-content"
      label-width="120px"
    >
      <el-col class="search-col">
        <el-form-item label="委托人" prop="client">
          <el-input v-model="searchParams.client"></el-input>
        </el-form-item>
        <el-form-item label="生产者" prop="producer">
          <el-input v-model="searchParams.producer"></el-input>
        </el-form-item>
        <el-form-item label="生产企业" prop="productionCompany">
          <el-input v-model="searchParams.productionCompany"></el-input>
        </el-form-item>
      </el-col>
      <el-col class="search-col">
        <el-form-item label="工厂编号" prop="companyId">
          <el-input v-model="searchParams.companyId"></el-input>
        </el-form-item>
        <el-form-item label="检测任务号" prop="testTaskId">
          <el-input v-model="searchParams.testTaskId"></el-input>
        </el-form-item>
      </el-col>
      <el-col class="search-col">
        <el-form-item label="检查类型" prop="testType">
          <el-select
            v-model="searchParams.testType"
            placeholder="请选择"
          >
            <el-option
              v-for="item in testTypeList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="省份" prop="province">
          <el-select
            v-model="searchParams.province"
            placeholder="请选择"
          >
            <el-option
              v-for="item in provinceList"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            >
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col class="search-col">
        <el-form-item label="实际开始" prop="stepStartTime">
          <el-date-picker
            v-model="searchParams.stepStartTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="至" prop="stepEndTime">
          <el-date-picker
            v-model="searchParams.stepEndTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col class="search-col">
        <el-form-item label="实际结束" prop="actualStartTime">
          <el-date-picker
            v-model="searchParams.actualStartTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="至" prop="actualEndTime">
          <el-date-picker
            v-model="searchParams.actualEndTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col class="search-col">
        <el-form-item label="评定时间" prop="evaluateStartTime">
          <el-date-picker
            v-model="searchParams.evaluateStartTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item label="至" prop="evaluateEndTime">
          <el-date-picker
            v-model="searchParams.evaluateEndTime"
            type="date"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col class="search-col operation-area">
        <el-button type="primary" @click="search">搜索</el-button>
        <el-button @click="reset">清空</el-button>
        <el-button @click="batchExport">批量导出</el-button>
      </el-col>
    </el-form>
    
    <el-tabs class="table-tabs" type="border-card">
      <el-tab-pane>
        <span slot="label">产品进度查询 {{tableData.length}}</span>
        <el-table border :data="tableData">
          <el-table-column prop="date" label="委托人"> </el-table-column>
          <el-table-column prop="date" label="生产者"> </el-table-column>
          <el-table-column prop="date" label="生产企业"> </el-table-column>
          <el-table-column prop="date" label="产品小类"> </el-table-column>
          <el-table-column prop="date" label="产品名称"> </el-table-column>
          <el-table-column prop="date" label="是否检查"> </el-table-column>
          <el-table-column prop="date" label="是否检测"> </el-table-column>
          <el-table-column prop="date" label="检查类型"> </el-table-column>
          <el-table-column prop="date" label="开始时间"> </el-table-column>
          <el-table-column prop="date" label="结束时间"> </el-table-column>
          <el-table-column prop="date" label="检查结论"> </el-table-column>
          <el-table-column prop="date" label="证书状态"> </el-table-column>
          <el-table-column prop="date" label="证书到期日"> </el-table-column>
          <el-table-column prop="date" label="评定日期"> </el-table-column>
          <el-table-column prop="date" label="评定状态"> </el-table-column>
          <el-table-column prop="date" label="分公司"> </el-table-column>
          <el-table-column prop="date" label="是否收费"> </el-table-column>
        </el-table>
      </el-tab-pane>
    </el-tabs>
  </el-col>
</template>

<script>
export default {
  name: 'stepSearch',
  data() {
    return {
      defulatParams: {
        client: "", // 委托人
        producer: "", // 生产者
        productionCompany: "", // 生产企业
        companyId: "", // 工厂编号
        testTaskId: "", // 检测任务号
        testType: "", // 检查类型
        province: "", // 省份
        stepStartTime: "", // 实际开始
        stepEndTime: "", // 至（实际开始）
        actualStartTime: "", // 实际结束
        actualEndTime: "", // 至（实际结束）
        evaluateStartTime: "", // 评定时间
        evaluateEndTime: "" // 至（评定时间）
      },
      searchParams: {
        ...this.defulatParams,
      },
      tableData: [], // 表格数据
      provinceList: [], // 省份列表
      testTypeList: [], // 测试类型列表
    };
  },
  mounted() {
    this.queryTableData();
  },
  methods: {
    search() {
      // todo: 搜索方法
    },
    reset() {
      this.searchParams = {
        ...this.defulatParams,
      };
      this.search();
    },
    batchExport() {
      // todo: 批量导出方法
    },
    queryTableData() {
      // todo：获取表格数据接口
    }
  },
};
</script>

<style lang="less" scoped>
.info-wrapper {
  font-family: Source Han Sans CN;
  font-weight: 400;
  height: 100%;

  .search-from {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid #c2d9e6;
    padding-top: 20px;
    margin-bottom: 20px;

    .search-col {
      display: flex;
    }

    .operation-area {
      margin-left: 20px;
      margin-bottom: 10px;
    }
  }
}
</style>
